	var click_num = 0;
    
    function confirm_OTAConf() {
        var frm = document.frm;
        var mes521 = document.getElementById("message521").value;
        var mes527 = document.getElementById("message527").value;
        var mes525 = document.getElementById("message525").value;
        var mes526 = document.getElementById("message526").value;
        var mes560 = document.getElementById("message560").value;
        var mesF13 = document.getElementById("messageF13").value;

            if( frm.operator.value == "" ){
                alert(mes527);
                return;
            }

            if ( !FFCheckBlank(frm.receiver,"",false) ) {
                alert(mes525);
                return;
            }

            var receiver = FFValidString(frm.receiver , FFSTRING_DEF_NUMBER, 1, 20);
            
			if ( receiver == -1 || receiver == -2 ) {
                alert(mes526);
                return;
            }
	        
	        if(frm.receiver.value.substring(0, 2) == "00"){
                alert(mes560);
                return;
            }
        
            var result = FFCheckBlank(frm.keyword,"",false);
			
            if (!result) {
                alert(mesF13);
                return;
            }
            
            linkCode(document.getElementById("btnConfirm"));
            
            if ( click_num < 1 ) {
                frm.target = "frmid_cm";
                frm.action = "/supporto/configurephone/mmsSettingConf.do";
                click_num++;
                frm.submit();
            }
        }

        function goFocus(){
            var frm = document.frm;
            frm.keyword.focus();
        }

        function goSuc(page) {
             document.location.href = page;
        }			

        function showPaytype(appear){
            document.getElementById("divpaytype").style.display = appear;			
        }

//        function showContract(){
//			var frm = document.getElementById("frm");
//			
//		    if(frm.operator.value == "0104404"){
//		    	document.getElementById("divcontract").style.display = "block";
//		    }else{
//		    	document.getElementById("divcontract").style.display = "none";
//		    }
//		}
        
        function makeSelectBox(){
        	new Selectbox('operator');
        }
        
        function goTab(Tran){
        	if(Tran == "WAP"){
        		document.frm2.action = "/supporto/configure-phone-setting-wap.do";
        		document.frm2.submit();
        	}else if(Tran == "MMS"){
        		document.frm2.action = "/supporto/configure-phone-setting-mms.do";
        		document.frm2.submit();
        	}
        } 
        
	/* Omniture Functions */
	function linkCode(obj) {
		var oOperator = document.getElementById("operator");

//		if (oHpmodel.value && oOperator.value) {
		if(oOperator.value) {
			var filename = "MMS Settings:" + fnGetSelectedOption(oOperator).text;

			var s = s_gi(s_account);
			s.linkTrackVars = "eVar6,events";
			s.linkTrackEvents = "event6";
			s.events = "event6";
			s.eVar6 = filename;
			s.tl(obj, "d", filename);			
		}	
	}
	
	// Return Selected Option
	function fnGetSelectedOption(oSelect) {
		var oOption;

		for (var i = 0; i < oSelect.childNodes.length; i++) {			
			oOption = oSelect.childNodes[i];

			if (oOption.tagName == "OPTION" && oOption.selected) break;			
		}

		return oOption;
	}         
